package day0318.math;

import java.security.SecureRandom;
import java.util.Arrays;

/**
 * @Author Stringzhua
 * @Date 2024/3/19 10:41
 * description:真随机数
 */
public class Math_04 {
    public static void main(String[] args) {
        //真随机数,随机的结果不可预测
        SecureRandom sr = new SecureRandom();
        //随机对象获取随机整数,浮点数,布尔等
        System.out.println(sr.nextInt());
        System.out.println(sr.nextInt(200));
        System.out.println(sr.nextDouble());
        System.out.println(sr.nextBoolean());

        byte[] bytes = new byte[10];
        sr.nextBytes(bytes);
        System.out.println(Arrays.toString(bytes));
    }
}
